﻿using System;
using System.Windows;
using System.Windows.Media.Imaging;
using Microsoft.Win32;

namespace POBR
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();
		}

		private void LoadButton_Click(object sender, RoutedEventArgs e)
		{
			var dialog = new OpenFileDialog();
			dialog.Title = "Choose image...";
			dialog.Filter = "JPG images (*.jpg, *.jpeg)|*.jpg;*.jpeg";

			var result = dialog.ShowDialog(this).Value;

			if (result)
			{
				Picture.Source = new BitmapImage(new Uri(dialog.FileName));
			}
		}

		private void ProcessButton_Click(object sender, RoutedEventArgs e)
		{
			Picture.Source = new ImageProcessor.ImageProcessor().Process(Picture.Source as BitmapSource);
		}
	}
}
